﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Eis51.BuildingHtml;
using Eis51.CampanyCMS.Model.Bus;

using Eis51.Web.Admin;

namespace Eis51.CampanyCMS.WebUI.Admin.Coupon
{
    public partial class CouponConfig : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ShowData();
            }
        }

        private void ShowData()
        {
             Regconfig r=new Regconfig() ;
             r = XmlData.XmlDeserialize(r.GetType(), "~/Regconfig.xml") as Regconfig;
             if (r != null)
             {
                 txtCouponNo.Text = r.CouponNo;
                 drpStatus.SelectedValue = r.IsCoupon.ToString() ;
             
             }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            Regconfig r=new Regconfig() ;
            r.CouponNo=txtCouponNo.Text;
            r.IsCoupon=int.Parse(drpStatus.SelectedValue) ;
            XmlData.Serialize(r, "~/Regconfig.xml");
        }
    }
}
